home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7827 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: solaris.cc.vt.edu!usenet
  2. From: sestes@vt.edu (Steven D. Estes)
  3. Newsgroups: comp.os.ms-windows.programmer.tools.owl,comp.lang.c++,comp.os.ms-windows.programmer.misc
  4. Subject: Re: GetDlgItemText??
  5. Date: 19 Feb 1996 15:12:26 GMT
  6. Organization: Virginia Tech
  7. Message-ID: <4ga40q$72r@solaris.cc.vt.edu>
  8. References: <4g92tf$1bt@felix.junction.net>
  9. NNTP-Posting-Host: jflora.bevc.blacksburg.va.us
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.14
  12.  
  13. In article <4g92tf$1bt@felix.junction.net>, imccalli@portage.net says...
  14. >
  15. >I want to get a string from a dialog box, say like a wanted to get 
  16. >
  17. >d:\games\solitare.exe
  18. >
  19. >
  20. >I figured I have to use the GetDlgItemText(think that's it) but when do 
  21. >use?
  22. >
  23. >Any info would be appreciative
  24. Well, if it's like the dialogs I have set up, there is a WM_INITDIALOG 
  25. case and a WM_COMMAND case.  Under the WM_COMMAND section I have two 
  26. cases: OK and Cancel.  Under the IDOK case (the user clicks OK), I call 
  27. the GetDlgItemText function, for example,
  28.  
  29. GetDlgItemText(hDlg, ID_Bus_Name, buffer,buffer_length);
  30. sscanf(buffer, "%s", &(buses[bus_highlight].name));
  31.  
  32. Hope this helps.
  33.  
  34. Steve Estes
  35. sestes@vt.edu
  36.  
  37.